#ifndef __USERPORTRS232_H
#define __USERPORTRS232_H

#include <stdbool.h>

typedef enum BAUDRATES {
	BAUD_300 = 0, BAUD_1200 = 1, BAUD_2400 = 2
} baud_t;

#ifdef __NODCD__
extern bool _dcd;
#endif

int cbm_open_rs232(char lfn, char device, char secondary, char *file);
char openRS232(char lfn, baud_t baud);
void enableRS232(void);
char readByteRS232(void);
void __fastcall__ writeByteRS232(char byte);
void closeRS232(char lfn);
char readStatus(void);
void setBaudRS232(baud_t oldBaud, baud_t newBaud);
bool readDCD(void);
bool readCTS(void);
bool readRI(void);
void setRTS(bool);
void setDTR(bool);
void hangUpCall(void);
void clearReadBuffer(void);

#endif